package ab.mes.mapper;

import ab.mes.entity.Working;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface WorkingMapper extends BaseMapper<Working> {
    //查询所有工序名称和图片
    @Select("SELECT photo,process_name FROM working")
    public List<Working> selectWorking1();
    //根据工序名称查询所有名称和图片
    @Select("select photo,process_name FROM working WHERE process_name = #{process_name}")
    public List<Working> selectByName(String process_name);
    //切换是否打印状态
    @Update("update working SET output_To_Print = #{output_To_Print} WHERE process_name = #{process_name}")
    public int updatePrintByName(@Param("process_name") String process_name,@Param("output_To_Print")Boolean output_To_Print);
    //切换是否首件检查状态
    @Update("update working SET first_Piece_Output_Limit = #{first_Piece_Output_Limit} WHERE process_name = #{process_name}")
    public int updateCheckByName(@Param("process_name") String process_name,@Param("first_Piece_Output_Limit") Boolean first_Piece_Output_Limit);
}
